package com.trainsmart.example.mdi.control
{
	import com.trainsmart.smartmvc.Context;
	import com.trainsmart.smartmvc.CtrlBase;
	
	import mx.collections.ArrayCollection;
	import mx.controls.List;

	public class RegisterWinCtrl extends CtrlBase
	{
		public function RegisterWinCtrl(context:Context)
		{
			super(context);
		}
		override public function execute(request:Object=null, response:Function=null):void
		{
			var list:List = context.getInSession("list") as List;
			var winId:Object = request["winId"];
			var array:ArrayCollection = new ArrayCollection();
			if(list.dataProvider!=null)
				array = list.dataProvider as ArrayCollection;
			array.addItem(winId);
			list.dataProvider = array; 
		}
		
	}
}